package com.pkufinalproject.cleverreminder.hibernate.entity;

import lombok.Data;
import org.json.JSONObject;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

@Data
public class User implements Serializable {
    private Integer id;
    private String username;
    private String password;
    private Set<RegularReminder> regularReminders;
    private Set<RequestReminder> requestReminders;

    @Override
    public String toString() {
        Map<String, String> memberMap = new HashMap<String, String>();
        memberMap.put("id", id.toString());
        memberMap.put("username", username);
        memberMap.put("password", password);
        JSONObject memberJson = new JSONObject(memberMap);
        return memberJson.toString();
    }
}
